package week2nd;

public class linkedstacktest {
    public static void main(String[] args) {
        LinkedStack linkedStack = new LinkedStack();

        //isEmpty测试
        if (linkedStack.isEmpty())
            System.out.println("栈为空.");
        else
            System.out.println("栈不为空.");

        //push测试
        System.out.println("push: \"1\",\"word\",\"99\"");
        linkedStack.push(1);
        linkedStack.push("word");
        linkedStack.push(99);

        System.out.println("push后: " + linkedStack.toString());
        System.out.println("size: " + linkedStack.size());

        //pop测试
        System.out.println(linkedStack.pop());
        System.out.println("pop后: " + linkedStack.toString());
        System.out.println("size: " + linkedStack.size());

        //peek测试
        System.out.println("peek结果: " + linkedStack.peek());

        //isEmpty测试
        if (linkedStack.isEmpty())
            System.out.println("栈为空.");
        else
            System.out.println("栈不为空.");

    }

}
